<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>
<style>
    .layui-form-item{
        margin-bottom: 8px;
    }
</style>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div id="cardBodyDiv" class="layui-card-body" style="padding: 15px;">
            <form class="layui-form layui-form-pane" action="" lay-filter="component-form-group">
                <input type="hidden" name="id" th:value="${entity.id}"/>
                <div class="layui-form-item">
                    <select name="score" class="selectedlv" th:attr="v=${entity.score}">
                        <option value="5">★★★★★</option>
                        <option value="4">★★★★</option>
                        <option value="3">★★★</option>
                        <option value="2">★★</option>
                        <option value="1">★</option>
                    </select>
                </div>
                <div class="layui-form-item">
                    <textarea style="width: 100%;height: 100px;"  name="content" th:text="${entity.content}" class="layui-input"></textarea>
                </div>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <a class="layui-btn" lay-submit="" lay-filter="component-form-demo1">保存</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div id="mContent" style="display: none" th:utext=" ${entity.content}">

</div>
<script src="/layuiadmin/layui/layui.js"></script>
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/base.js"></script>
<script>
    selected();
    //设置富文本
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate','upload'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,form = layui.form;
        form.render(null, 'component-form-group');
        laydate.render({
            elem: '#LAY-component-form-group-date'
        });
        /* 监听提交 */
        form.on('submit(component-form-demo1)', function(data){
            var da = data.field;
            basePost({
                url:"/order/commentData.do",
                data:da,
                success:function (req) {
                    layer.confirm('感谢您的评论，我们将更好的为您服务！', {
                        title: '提示',
                        btn: ['确定'], //按钮
                        closeBtn: 0
                    }, function(){
                        window.parent.location.reload();
                    });
                }
            })
            return false;
        });
    });

</script>

</body>

</html>
